/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cse333.panels;

import cse333.PanelSwitcher;
import cse333.SwitchablePanel;

public class ScholarshipViewPanel extends SwitchablePanel {

    private PanelSwitcher pc;
    
    public ScholarshipViewPanel(PanelSwitcher pc) {
        initComponents();
        this.pc = pc;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        titleLabel = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        uploadLabel = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        addFileButton = new javax.swing.JButton();
        essayTitleLabel = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        essayTextLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        essayText = new javax.swing.JTextArea();
        applyButton1 = new javax.swing.JButton();
        essayLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();

        setBackground(new java.awt.Color(0, 0, 0));
        setLayout(new java.awt.GridBagLayout());

        titleLabel.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N
        titleLabel.setForeground(new java.awt.Color(255, 255, 255));
        titleLabel.setText("ScholarshipNameHere");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        add(titleLabel, gridBagConstraints);

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Description");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(15, 30, 0, 0);
        add(jLabel1, gridBagConstraints);

        uploadLabel.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        uploadLabel.setForeground(new java.awt.Color(255, 255, 255));
        uploadLabel.setText("Upload Files");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(15, 30, 0, 0);
        add(uploadLabel, gridBagConstraints);

        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("<html>Requirement 1<br/> Requirement 2<br/> Requirement 3<br/> Requirement 4<br/> Requirement 5<br/> Requirement 6<br/></html> ");
        jLabel4.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        add(jLabel4, gridBagConstraints);

        addFileButton.setBackground(new java.awt.Color(204, 102, 0));
        addFileButton.setForeground(new java.awt.Color(255, 255, 255));
        addFileButton.setText("Add File");
        addFileButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
        addFileButton.setContentAreaFilled(false);
        addFileButton.setMaximumSize(new java.awt.Dimension(100, 29));
        addFileButton.setOpaque(true);
        addFileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addFileButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.ipadx = 100;
        gridBagConstraints.ipady = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 30, 10, 0);
        add(addFileButton, gridBagConstraints);

        essayTitleLabel.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        essayTitleLabel.setForeground(new java.awt.Color(255, 255, 255));
        essayTitleLabel.setText("Essay");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(15, 30, 0, 0);
        add(essayTitleLabel, gridBagConstraints);

        jLabel7.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Requirements");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(15, 30, 0, 0);
        add(jLabel7, gridBagConstraints);

        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("<html>Cultivated who resolution connection motionless did occasional. Journey promise if it colonel. Can all mirth abode nor hills added. Them men does for body pure. Far end not horses remain sister. Mr parish is to he answer roused piqued afford sussex. It abode words began enjoy years no do ﻿no. Tried spoil as heart visit blush or. Boy possible blessing sensible set but margaret interest. Off tears are day blind smile alone had. </html>");
        jLabel8.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel8.setMaximumSize(new java.awt.Dimension(500, 1024));
        jLabel8.setMinimumSize(new java.awt.Dimension(500, 16));
        jLabel8.setPreferredSize(new java.awt.Dimension(500, 16));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.ipady = 100;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        add(jLabel8, gridBagConstraints);

        essayTextLabel.setForeground(new java.awt.Color(255, 255, 255));
        essayTextLabel.setText("<html>Some text about the essay he needs to write. Cultivated who resolution connection motionless did occasional. Journey promise if it colonel. Can all mirth abode nor hills added. Them men does for body pure. Far end not horses remain sister. Mr parish is to he answer roused piqued afford sussex.</html>");
        essayTextLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        essayTextLabel.setMaximumSize(new java.awt.Dimension(500, 1024));
        essayTextLabel.setMinimumSize(new java.awt.Dimension(500, 16));
        essayTextLabel.setPreferredSize(new java.awt.Dimension(500, 16));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.ipady = 50;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        add(essayTextLabel, gridBagConstraints);

        essayText.setColumns(20);
        essayText.setRows(5);
        jScrollPane1.setViewportView(essayText);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.ipadx = 450;
        gridBagConstraints.ipady = 100;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        add(jScrollPane1, gridBagConstraints);

        applyButton1.setBackground(new java.awt.Color(204, 102, 0));
        applyButton1.setForeground(new java.awt.Color(255, 255, 255));
        applyButton1.setText("Apply");
        applyButton1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
        applyButton1.setContentAreaFilled(false);
        applyButton1.setMaximumSize(new java.awt.Dimension(100, 29));
        applyButton1.setOpaque(true);
        applyButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                applyButton1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.ipadx = 100;
        gridBagConstraints.ipady = 5;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 20, 0);
        add(applyButton1, gridBagConstraints);

        essayLabel.setForeground(new java.awt.Color(255, 255, 255));
        essayLabel.setText("essay.pdf");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridy = 7;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        add(essayLabel, gridBagConstraints);

        progressBar.setValue(75);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.ipadx = 300;
        gridBagConstraints.ipady = 10;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 100, 0, 0);
        add(progressBar, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents

    private void addFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFileButtonActionPerformed


    }//GEN-LAST:event_addFileButtonActionPerformed

    private void applyButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_applyButton1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addFileButton;
    private javax.swing.JButton applyButton1;
    private javax.swing.JLabel essayLabel;
    private javax.swing.JTextArea essayText;
    private javax.swing.JLabel essayTextLabel;
    private javax.swing.JLabel essayTitleLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel titleLabel;
    private javax.swing.JLabel uploadLabel;
    // End of variables declaration//GEN-END:variables

    @Override
    public void sendData(Object object) {
        try {
            if ((Boolean) object) {
                addFileButton.setVisible(false);
                progressBar.setVisible(false);
                essayText.setText("Some Text the user wrote");
                uploadLabel.setText("Uploaded Files");
                addFileButton.setVisible(false);
            } else {
                addFileButton.setVisible(true);
                progressBar.setVisible(true);
                essayText.setText("");
                uploadLabel.setText("Upload Files");
                addFileButton.setVisible(true);
            }
        } catch (ClassCastException e) {
            e.printStackTrace();
        }
        
        invalidate();
        repaint();
    }

    @Override
    public void onSwitch() {
    }
}
